#include<iostream>
using namespace std;
int main()
{
    int t;
    cin>>t;
    long long n,a,b;
    while(t--)
    {
        long long sum=0;//tip1
        cin>>n>>a>>b;
        if(n<=2)//tip2
        {
            cout<<min(a,b)<<endl;
            continue;
        }
        if(a/2.0<=b/3.0)
        {
            sum+=n/2*a;
            if(n%2==1)
            {
                sum+=min(a,min(b,-a+b));
            }
        }
        else
        {
            sum+=n/3*b;
            if(n%3==1)
            {
                sum+=min(a,min(b,-b+2*a));
            }
            else if(n%3==2)
            {
                sum+=min(a,min(b,-b+3*a));
            }
        }
        cout<<sum<<endl;
        
    }
    
    return 0;
}